package com.yunwaikeji.gy_tool_library.utils;

import android.content.Context;
import android.widget.Toast;

public class GYToastUtils {
    private static Context context;

    public static void init(Context context) {
        GYToastUtils.context = context;
    }

    public static void show(String tip, int duration) {
        if (context == null) {
            GYLogUtils.printError("GYToastUtils", "未初始化");
            return;
        }
        Toast.makeText(context, tip, duration).show();
    }

    public static void showShort(String tip) {
        show(tip, Toast.LENGTH_SHORT);
    }

    public static void showLong(String tip) {
        show(tip, Toast.LENGTH_LONG);
    }
}
